package com.course.web.view;

import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewDisplay;
import com.vaadin.spring.annotation.SpringViewDisplay;
import com.vaadin.spring.navigator.SpringViewProvider;
import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Justin on 2017/5/31.
 */
@SpringViewDisplay
public class ViewDisplayPanel extends Panel implements ViewDisplay {

    @Autowired
    public ViewDisplayPanel(SpringViewProvider viewProvider) {
        viewProvider.setAccessDeniedViewClass(AccessDeniedView.class);
    }

    @Override
    public void showView(View view) {
        setContent((Component) view);
    }
}
